package spaceinvaders.engine;

import javax.swing.JPanel;
import spaceinvaders.elements.ElementoCriar.ElementosAnimados;

/**
 *
 * @author Luis Freitas
 */
public class Engine extends JPanel implements TimerListener {

    protected int VelX = 10;
    protected int VelY = 0;
    protected int dVx = 1;
    protected int dVy = 1;

    public int setMovimentoHorizontal(ElementosAnimados Elem,boolean FLAG) {
        if (Elem == ElementosAnimados.CANHAO) {

        } else if (Elem == ElementosAnimados.INVASOR) {
            if(FLAG == true)
                this.dVx = this.dVx*(-1);          
            return VelX * dVx;
        }
        return 0;
    }

    public int setMovimentoVertical(ElementosAnimados Elem, boolean FLAGX,boolean FLAGY) {
        if (Elem == ElementosAnimados.CANHAO) {
        } else if (Elem == ElementosAnimados.INVASOR) {
            if(FLAGX == true && FLAGY == false)
                return 25;
        }
        return 0;
    }

    public void update() {
    }
}
